package goUtils

import (
	"github.com/GUAIK-ORG/go-snowflake/snowflake"
	"strconv"
)

type ID struct {
}

func (c *ID) GetSnowflakeId(dataCenterId, workerId int64) (string, error) {
	s, err := snowflake.NewSnowflake(dataCenterId, workerId)
	if err != nil {
		return "", err
	} else {
		id := s.NextVal()
		return strconv.FormatInt(id, 10), nil
	}
}
